<SCRIPT language=JavaScript>
var message="";
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")
</SCRIPT>
<?
$maxacc=10000;
include("db.php");
$accts=mssql_query("SELECT memb___id FROM MEMB_INFO");
$rows=mssql_num_rows($accts);
if(isset($_POST['login'])){
	$login=$_POST['login'];
	$senha=$_POST['senha'];
	$email=$_POST['email'];
	$nome=$_POST['nome'];
	$verify=mssql_query("SELECT memb___id FROM MEMB_INFO WHERE memb___id='".$login."'");
	$ok=mssql_num_rows($verify);
	if($rows>=$maxacc){
		$resultado="Max acc exedido";
	}
	else if($ok>0){
		$resultado="Já existe login $login";
	}
	else{
		mssql_query("SET IDENTITY_INSERT MEMB_INFO ON");
		$msquery = "INSERT INTO MEMB_INFO (memb_guid,memb___id,memb__pwd,memb_name,sno__numb,post_code,addr_info,addr_deta,tel__numb,mail_addr,phon_numb,fpas_ques,fpas_answ,job__code,appl_days,modi_days,out__days,true_days,mail_chek,bloc_code,ctl1_code) VALUES ('1','$login','$senha','$nome', '1','Brasil','nao interessa','idnumb','12343','$email','fone','squess','squess','1','2003-11-23','2003-11-23','2003-11-23','2003-11-23','1','0','1')";
		mssql_query($msquery);
		$msquery4 = "INSERT INTO VI_CURR_INFO (ends_days,chek_code,used_time,memb___id,memb_name,memb_guid,sno__numb,Bill_Section,Bill_value,Bill_Hour,Surplus_Point,Surplus_Minute,Increase_Days )  VALUES ('2005','1',1234,'$login','nome',1,'7','6','3','6','6','2003-11-23 10:36:00','0' )";
		mssql_query($msquery4);
		$rows++;
		$resultado="ACC $login Criada";
	}
echo "<script>alert('$resultado')</script>";
}
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
/* Hyperlink */
a:link {	color: #000000;	text-decoration: none;}
a:visited {	color: #000000; text-decoration: none;}
a:hover {	color: #000000; text-decoration: none;}
a:active {	color: #0000000; text-decoration: none;}
.camposs {	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 9px;
	background-color: #2b2b2b;
	border: 1px solid #FFFFFF;
	color: #FFFFFF;
}
.camposs2 {	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 9px;
	background-color: #999999;
	border: 1px solid #666666;
}
body,td,th {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	color: #FFFFFF;
	font-size: 9px;
}
body {
	margin-left: 15px;
	margin-top: 15px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #2b2b2b;
}
-->
</style>
<script>
function send(){
	erro='';
	if(document.form1.login.value==''){ erro+='Login está em branco \n'; }
	if(document.form1.senha.value==''){ erro+='Senha está em branco \n'; }
	if(document.form1.email.value==''){ erro+='Email está em branco \n'; }
	if(document.form1.nome.value==''){ erro+='Nome está em branco \n'; }
	if(erro!=''){ alert(erro) }
	else { document.form1.submit() }
}
</script>
<title>ACC</title>
</head>
<body scroll=no">
<table width="100%" height="90%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center" valign="middle"><form name="form1" method="post">
      <table width="268" border="0" cellpadding="0" cellspacing="0">
             <tr>
               <td width="67">Login:</td>
          <td width="201"><input name="login" type="text" class="camposs" id="login" size="40"></td>
        </tr>
        <tr>
          <td>Senha:</td>
          <td><input name="senha" type="password" class="camposs" id="senha" size="40"></td>
        </tr>
        <tr>
          <td>Email:</td>
          <td><input name="email" type="text" class="camposs" id="email" size="40"></td>
        </tr>
        <tr>
          <td class="login">Nome</td>
          <td class="login"><input name="nome" type="text" class="camposs" id="email22" size="40"></td>
        </tr>
        <tr>
          <td class="login">&nbsp;</td>
          <td class="login">&nbsp;</td>
        </tr>
        <tr>
          <td class="login">&nbsp;</td>
          <td class="login">		    <div align="right">
                <input name="Button" type="button" class="camposs2" value="Criar" onClick="send()">		    
                         </div></td>
        </tr>
        </table>
    </form></td>
  </tr>
</table>
</body>
</html>
